//
//  constants.hpp
//  EnTT Pacman
//
//  Created by Indiana Kernick on 22/9/18.
//  Copyright © 2018 Indiana Kernick. All rights reserved.
//

#ifndef CORE_CONSTANTS_HPP
#define CORE_CONSTANTS_HPP

#include "util/pos.hpp"
#include "util/dir.hpp"

//该头放该项目不变的参数

// The width and height of the maze in tiles 整个迷宫的宽高比是19：22
constexpr Pos tiles = {19, 22};
// The pixel size of tiles  瓦片的像素大小 8 * 8
constexpr int tileSize = 8;
// The width and height of the maze in pixels 整个迷宫的像素大小
constexpr Pos tilesPx = tiles * tileSize;
// The amount of ticks that ghosts are scared for 鬼的害怕 滴答 时限
constexpr int ghostScaredTime = 40;

// The amount of ticks left on the scared timer before scared ghosts
// start flashing 剩余10*8 80帧 开始闪烁 相当于 4秒
constexpr int ghostScaredFlashTime = 10;
// Related to flash speed. Higher is slower 鬼害怕的闪烁比率
constexpr int ghostScaredFlashRate = 4;

// 赢得游戏所需要吃的点数
// The total number of dots that the player must eat to win the game
constexpr int dotsInMaze = 152;

// Position where the player spawns 玩家生成的 位置
constexpr Pos playerSpawnPos = {9, 16};
// 玩家生成时所面向的方向
// Direction that the player is facing and moving when they spawn 
constexpr Dir playerSpawnDir = Dir::left;
// A position just outside the ghost house above the door 鬼屋外的 位置
constexpr Pos outsideHouse  = { 9,  8};

// Home positions are the places in the house where ghosts go
// 鬼回家的位置
constexpr Pos blinkyHome    = { 9, 10};
constexpr Pos pinkyHome     = { 9, 10};
constexpr Pos inkyHome      = { 8, 10};
constexpr Pos clydeHome     = {10, 10};
// Scatter positions are targets that ghosts move towards (but never reach)
// when in scatter mode
// 四只鬼分别朝四个角分散
constexpr Pos blinkyScatter = {18,  0};
constexpr Pos pinkyScatter  = { 0,  0};
constexpr Pos inkyScatter   = {18, 21};
constexpr Pos clydeScatter  = { 0, 21};

// The amount of time ghosts will be in scatter mode before switching
// to chase mode
// 由于游戏逻辑是每8帧改变一次, 相当于要120帧 也就是6秒
constexpr int scatterTicks = 15; //6秒
// The amount of time ghosts will be in chase mode before switching
// to scatter mode
// 由于游戏逻辑是每8帧改变一次, 相当于要320帧 也就是16秒
constexpr int chaseTicks = 40;
// The frame rate. The game speed in set as 8 times slower than the frame rate
constexpr int fps = 20; // 帧率 游戏速度设置为帧率的8倍慢 每8个画面为游戏中的一个逻辑原子时间

#endif
